package com.eksboot.proxy.dynamic3;

/**
 * TransactionInterceptor
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2021-05-25 15:16
 */
public class TransactionInterceptor implements Interceptor{
    @Override
    public Object intercept(Invocation invocation) throws Exception{
        System.out.println(" 开启事务 ");
        Object result = invocation.process();
        System.out.println(" 提交事务 ");
        return result;
    }

    @Override
    public Object plugin(Object target) {
        return TargetProxy.wrap(target,this);
    }

}
